﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>421实验室服务器使用指南</title>
    <link rel="alternate" type="application/rss+xml" title="egrappler.com" href="feed/index.html">
    <link href="http://fonts.googleapis.com/css?family=Raleway:700,300" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/prettify.css">
</head>

<body>
<nav>

    <div class="container">
        <h1>421LAB</h1>
        <div id="menu">
            <ul class="toplinks">
                <li><a href="#">实验室主页</a></li>
                <li><a href="#">服务器使用指南</a></li>
                <li><a href="#">网盘使用指南</a></li>
                <li><a href="#">预留模块</a></li>
            </ul>
        </div>
        <a id="menu-toggle" href="#" class=" ">&#9776;</a>
    </div>
</nav>
<header>
  <div class="container">
    <h2 class="docs-header"> 服务器使用指南</h2>
  </div>
</header>
<section>
    <div class="container">
        <!--左侧导航栏-->
        <ul class="docs-nav" id="menu-left">
            <li><strong>用户管理</strong></li>
            <li><a href="#createUser" class=" ">新建用户</a></li>
            <li><a href="#changePassword" class=" ">修改密码</a></li>
            <li><a href="#deleteUser" class=" ">删除用户</a></li>
            <li><a href="#modifyUser" class=" ">修改用户</a></li>
            <li><a href="#empowerSUDO" class=" ">配置sudo权限</a></li>
            <li class="separator"></li>
            <li><strong>系统管理</strong></li>
            <li><a href="#view_type" class=" ">若干常用命令</a></li>
            <li><a href="#animation_style" class=" ">查看当前系统的时间</a></li>
            <li><a href="#bars_text" class=" ">查看有谁在线（哪些人登陆到了服务器）</a></li>
            <li><a href="#vote_counter" class=" ">查看主机名</a></li>
            <li><a href="#rating_icons" class=" ">修改主机名(重启后无效)</a></li>
            <li><a href="#rating_titles" class=" ">Rating Titles</a></li>
            <li><a href="#bar_colors" class=" ">Bar Colors</a></li>
        </ul>


    <!----------------------------------------------------------------------------------------------------------------->
    <div class="docs-content">

        <!--用户管理大标题模块----------------------------------------------------------------------------------------->
        <h2> 用户管理</h2>
        <p>添加完用户后应立刻修改密码，这样才能使新建的用户生效。</p>


        <!--新建用户模块----------------------------------------------------------------------------------------------->
        <h3 id="createUser"> 新建用户</h3>
        <p>【制定规则】</p>
        <p>
            姓氏全拼+名字首字母（均为小写）如王老师（wangls）、郭老师（guols）。
            现在分别给王老师和郭老师创建一个账户。
        </p>
        <p>【举例如下】</p>
        <pre class="prettyprint">
                命令：
                useradd -r -m -s /bin/bash [用户名]
                举例：
                useradd -r -m -s /bin/bash wangls
                useradd -r -m -s /bin/bash guols</pre>
        <p>【命令解释】</p>
        <p>-m：创建用户主目录</p>
        <p>-s：指定指定用户的默认shell，可用的所有shell列表存储在/etc/shells文件中。</p>


        <!--修改密码模块------------------------------------------------------------------------------------------------>
        <h3 id="changePassword"> 修改密码</h3>
        <p>【说明】</p>
        <p>添加完用户后，需要立刻修改密码，才能使得新建的用户生效。修改用户密码也是使用相同的方法。</p>
        <p>【设定规则】</p>
        <p>用户名+123。如王老师的密码是wangls123，郭老师的密码是guols123。</p>
        <p>【举例如下】</p>
        <p>将用户wangls的密码设置为wangls123（输入如下命令以后，系统会提示输入密码）</p>
        <pre class="prettyprint">
                命令：
                passwd [用户名]
                举例：
                passwd wangls</pre>


        <!--删除用户模块------------------------------------------------------------------------------------------------>
        <h3 id="deleteUser"> 删除用户</h3>
        <p>【说明】</p>
        <p>1在删除用户时，待删除用户可能会占用某进程而导致无法删除，所以需要先结束进程。或者可以将用户强制下线。</p>
        <p>【命令】</p>
        <p>userdel [用户名]</p>
        <p>【举例如下】</p>
        <p>删除用户hehc</p>
        <pre class="prettyprint">
                1、先删除用户，命令如下：
                    userdel hehc
                2、若遇到进程6809占用，先结束进程6809，命令如下：
                    kill -9 6809
                3、删除home目录下的用户文件,命令如下：
                    rm -rf /home/hehc</pre>


        <!--修改用户模块------------------------------------------------------------------------------------------------>
        <h3 id="modifyUser"> 修改用户</h3>
        <p>【举例如下】</p>
        <p>举例1：将mytest用户的登录目录改成 `/home/test `，并加入test2组，注意这里是大G。</p>
        <pre class="prettyprint">
            举例1：将mytest用户的登录目录改成 `/home/test `，并加入test2组，注意这里是大G。
                usermod -d /home/test -G test2 mytest
            举例2：将用户mytest加入到test2组
                gpasswd -a mytest test2
            举例3：#将用户mytest从test2组中移出
                gpasswd -d test test2</pre>

        <!--配置SUDO权限------------------------------------------------------------------------------------------------>
        <h3 id="empowerSUDO"> 配置SUDO权限</h3>
        <p>【说明】</p>
        <p>当某用户操在作上需要用sudo命令的时候，需要在管理员用户下为用户授权。</p>
        <p>【举例如下】</p>
        <p>修改 /etc/sudoers 文件，找到下面一行，在root下面添加一行，如下所示：</p>
        <pre class="prettyprint">
            ## Allow root to run any commands anywhere
            root    ALL=(ALL)     ALL
            hehc  ALL=(ALL)     ALL</pre>


      <h2> Customizing Opineo</h2>
      <p> Before you make any cusomization or even start using Opineo create a 'div' element
        and assign it some id. Now add references to necessary Javascrip files e.g.</p>
      <ul>
        <li>A reference to latest jQuery library </li>
        <li>A reference to Opineo script file sudo nano opineo.js</li>
      </ul>
      <p> The following customization options are available in Opineo:</p>
      <h3 id="view_type"> View Type</h3>
      <ul>
        <li>Detailed View</li>
      </ul>
     
      <pre class="prettyprint">&lt;script&gt;
      	$(document).ready(function (){
        $('#DefaultOptions').opineo('results.php', {curvalue:3,
            view: 'detailed',
            animation_speed: 'super',
            show_total_votes_counter: false,
            show_overall_rating: true});
         })
&lt;/script&gt;</pre>
      <ul>
        <li>Compact View</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
	$(document).ready(function (){
	$('#CompactView').opineo('results.php',
    	    {curvalue:3, view: 'compact',
    	    animation_speed: 'super'});
	})
&lt;/script&gt;</pre>
      <ul>
        <li>Mini View</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#MiniView').opineo('results.php', {curvalue:0, view: 'mini', callback: myCallback});
    })	
&lt;/script&gt;</pre>
      <h3 id="animation_style"> Animation Style</h3>
      <ul>
        <li>Slow</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', animation_speed:'slow'});
    })	
&lt;/script&gt; </pre>
      <ul>
        <li>Medium</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', animation_speed:'mild'});
    })	
&lt;/script&gt; </pre>
      <ul>
        <li>Fast</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', animation_speed:'fast'});
    })	
 &lt;/script&gt;</pre>
      <ul>
        <li>Super Fast</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', animation_speed:'super'});
    })	
&lt;/script&gt;</pre>
      <ul>
        <li>Ultra Fast</li>
      </ul>
      <pre class="prettyprint"> &lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', animation_speed:'ultra fast'});
    })	
&lt;/script&gt; </pre>
      <h3 id="bars_text"> Bars Text</h3>
      <ul>
        <li>Show</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', votes_label:true});
    })	
&lt;/script&gt;</pre>
      <ul>
        <li>Hide</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', votes_label:false});
    })	
 &lt;/script&gt;</pre>
      <h3 id="vote_counter"> Vote Counter</h3>
      <ul>
        <li>Show</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', show_votes_counter:true});
    })	
&lt;/script&gt; </pre>
      <ul>
        <li>Hide</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', votes_label:false});
    })	
&lt;/script&gt;</pre>
      <h3 id="rating_icons"> Rating Icons</h3>
      <ul>
        <li>Colored</li>
        <li>Grey</li>
      </ul>
      <h3 id="rating_titles"> Rating Titles</h3>
      <ul>
        <li>Text For First Star</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', star_1_text:'Hate It'});
    })	
&lt;/script&gt;</pre>
      <ul>
        <li>Text For Second Star</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', star_2_text:'Don't Like It'});
    })	
&lt;/script&gt; </pre>
      <ul>
        <li>Text For Third Star</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', star_1_text:'Its OK'});
    })	
&lt;/script&gt;</pre>
      <ul>
        <li>Text For Fourth Star</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', star_1_text:'Like It'});
    })	
&lt;/script&gt;</pre>
      <ul>
        <li>Text For Fifth Star</li>
      </ul>
      <pre class="prettyprint">&lt;script&gt;
    $(document).ready(function (){
    $('#opineo').opineo('results.php', {curvalue:0, view: 'mini', star_1_text:'Love It'});
    })	
&lt;/script&gt;</pre>
      <h3 id="bar_colors"> Bar Colors</h3>
      <ul>
        <li>Colors of Red Bar</li>
        <li>Colors of Yellow Bar</li>
        <li>Colors of Green Bar</li>
      </ul>
    </div>
  </div>
</section>
<section class="vibrant centered">
  <div class="container">
    <h4> This documentation template is provided free by eGrappler.com. Opineo is a feedback
      collection widget and is available for free download <a href="#"> here</a></h4>
  </div>
</section>
<footer>
  <div class="container">
    <p> &copy; 2018 版权所有：421实验室 | 指导老师：王老师、郭老师 | 制作：何浩驰、方媛 </p>
  </div>
</footer>
<script src="js/jquery.min.js"></script> 
 
<script type="text/javascript" src="js/prettify/prettify.js"></script> 
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?lang=css&skin=sunburst"></script>
<script src="js/layout.js"></script>
 <script src="js/jquery.localscroll-1.2.7.js" type="text/javascript"></script>
 <script src="js/jquery.scrollTo-1.4.3.1.js" type="text/javascript"></script>
</body>
</html>
